'use strict';

const kss = require('kss');
const path = require('path');
const root = path.join(__dirname, '..');
const dest = path.join(root, 'docs', 'styleguide');
const template = path.join(root, 'src', 'docs', 'styleguide', 'template');
const title = require(path.join(root, 'package.json')).name + ' styleguide';
const source = path.join(root, 'src', 'stylesheets');
const css = [path.join('dist', 'styles.css'),
             path.join('src', 'docs', 'styleguide.css')];
const js = path.join('node_modules', 'jquery', 'dist', 'jquery.min.js');

/**
 * Generate styleguide
 *
 * @method styleguide
 */
function styleguide() {
  return (done) =>
    kss({
      template,
      title,
      source,
      js,
      css,
      destination: dest,
    }, done);
}

module.exports = styleguide;
